package com.example.earthquake.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

import android.location.Location;

public class Quake {
	
	public static final String HOSTNAME = "http://earthquake.usgs.gov";
	
	public static final String TAG_ENTRY = "entry";
	public static final String TAG_TITLE = "title";
	public static final String TAG_GEORSS_POINT = "georss:point";
	public static final String TAG_UPDATED = "updated";
	public static final String TAG_LINK = "link";
	
	public static final String ATTR_HREF = "href";

	private Date date;
	private String details;
	private Location location;
	private double magnitude;
	private String link;
	
	public Quake(Date date, String details, Location location,
			double magnitude, String link) {
		super();
		this.date = date;
		this.details = details;
		this.location = location;
		this.magnitude = magnitude;
		this.link = link;
	}

	public Date getDate() {
		return date;
	}

	public String getDetails() {
		return details;
	}

	public Location getLocation() {
		return location;
	}

	public double getMagnitude() {
		return magnitude;
	}

	public String getLink() {
		return link;
	}

	@Override
	public String toString() {
		SimpleDateFormat sdf = new SimpleDateFormat("HH.mm");
		String dateString = sdf.format(date);
		return dateString + ": " + magnitude + " " + details;
	}
	
}
